package com.example.whatrubbish.service.impl;

import com.example.whatrubbish.mapper.CommodityDetailMapper;
import com.example.whatrubbish.model.CommodityDetail;
import com.example.whatrubbish.service.CommodityDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommodityDetailServiceImpl implements CommodityDetailService {
    @Autowired
    CommodityDetailMapper commodityDetailMapper;

    @Override
    public CommodityDetail selectByCommodityId(Long commodityId) {
        return commodityDetailMapper.selectByCommodityId(commodityId);
    }

    @Override
    public CommodityDetail selectByPrimaryKey(Long id) {
        return commodityDetailMapper.selectByPrimaryKey(id);
    }

    @Override
    public int deleteByCommodityId(Long commodityId) {
        return commodityDetailMapper.deleteByCommodityId(commodityId);
    }

    @Override
    public int insertSelective(CommodityDetail record) {
        return commodityDetailMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(CommodityDetail record) {
        return commodityDetailMapper.updateByPrimaryKeySelective(record);
    }
}
